<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Draw a line</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.printer-draw-elipse.html">printer_draw_elipse</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.printer-draw-pie.html">printer_draw_pie</a></div>
 <div class="up"><a href="ref.printer.html">Printer 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.printer-draw-line" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">printer_draw_line</h1>
  <p class="verinfo">(PECL printer SVN)</p><p class="refpurpose"><span class="refname">printer_draw_line</span> &mdash; <span class="dc-title">Draw a line</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.printer-draw-line-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>printer_draw_line</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$printer_handle</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$from_x</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$from_y</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$to_x</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$to_y</code></span>
   )</div>

  <p class="para rdfs-comment">
   The function draws a line using the selected pen.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.printer-draw-line-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">printer_handle</code></em></dt>

     <dd>

      <p class="para">
       <em><code class="parameter">printer_handle</code></em> must be a valid printer handle.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">from_x</code></em></dt>

     <dd>

      <p class="para">
       <em><code class="parameter">from_x</code></em> is the x coordinate of the origin point.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">from_y</code></em></dt>

     <dd>

      <p class="para">
       <em><code class="parameter">from_y</code></em> is the y coordinate of the origin point.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">to_x</code></em></dt>

     <dd>

      <p class="para">
       <em><code class="parameter">to_x</code></em> is the x coordinate of the destination point.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">to_y</code></em></dt>

     <dd>

      <p class="para">
       <em><code class="parameter">to_y</code></em> is the y coordinate of the destination point.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.printer-draw-line-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.printer-draw-line-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-5250">
    <p><strong>Example #1 <span class="function"><strong>printer_draw_line()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$handle&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">printer_open</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">printer_start_doc</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"My&nbsp;Document"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">printer_start_page</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$pen&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">printer_create_pen</span><span style="color: #007700">(</span><span style="color: #0000BB">PRINTER_PEN_SOLID</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">30</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"000000"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">printer_select_pen</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$pen</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">printer_draw_line</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">10</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1000</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">10</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">printer_draw_line</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">60</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">500</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">60</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">printer_delete_pen</span><span style="color: #007700">(</span><span style="color: #0000BB">$pen</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">printer_end_page</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">printer_end_doc</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">printer_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

 
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.printer-draw-elipse.html">printer_draw_elipse</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.printer-draw-pie.html">printer_draw_pie</a></div>
 <div class="up"><a href="ref.printer.html">Printer 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
